<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>date</title>
		<script>
		 var d=new Date();
		 alert(d);
		 alert("month:"+d.getMonth());
		 alert("当地时间："+d.toLocaleString());
		 alert("UTC:"+d.toUTCString());
		 //document.getElementById("timer").innerHTML=d.toLocaleString();
		
		function showTime(){
			var d=new Date();
			document.getElementById("timer").innerHTML=d.toLocaleString();
		}
		</script>
	</head>
	<body onload="showTime()">
		<div id="timer">
			
		</div>
	</body>
</html>
